<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="../layui/css/layui.css">
    <script src="../layui/layui.js"></script>
    <script src="../scripts/jquery.min.js"></script>
    <script src="../js/jquery-form.js"></script>

    <style type="text/css">
        .for_img_upload{

        }
    </style>

    <title>试题信息</title>
    <style>
        body{padding: 10px;}
        .change_size{
            height: 100px;
        }
    </style>
</head>

<body>

<input type="hidden" id="flag_manager" value=<%=session.getAttribute("flag_manager")%> />


<form  class="layui-form layui-form-pane1" id="subform" method="post">


    <div class="layui-form-item">
        <label class="layui-form-label">试题id</label>
        <div class="layui-input-block">
            <input type="text" id="question_id" name="user_name" value=${param.question_id} readonly="readonly" lay-verify="required|title"   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">题干</label>
        <div class="layui-input-block">
            <textarea id="question_content" readonly="readonly" name="question_content" class="layui-textarea change_size"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">图片</label>
        <div class="layui-input-block">
            <img id="question_img" width="100" height="100" />
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">选项</label>
        <div class="layui-input-block">
            <textarea id="question_option" readonly="readonly" name="question_content" class="layui-textarea change_size"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">答案</label>
        <div class="layui-input-block">
            <input type="text" id="question_answer" name="user_name" value=${param.question_id} readonly="readonly" lay-verify="required|title"   autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <input type="text" id="question_class" name="user_name" readonly="readonly" lay-verify="required|title"  autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">来源</label>
        <div class="layui-input-block">
            <input type="text" id="question_ori" name="user_name" readonly="readonly" lay-verify="required|title"  autocomplete="off" class="layui-input">
        </div>
    </div>


</form>


<script>
    //加载layui信息
    layui.use('form', function(){
        var form = layui.form;
        //layui日期选择
        layui.use('laydate', function(){
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#createTime', //指定元素
                value: new Date()
            });
        });
    });

    var layer;
    layui.use('layer', function(){
        layer = layui.layer;

    })

    window.onload=function (){
        $.ajax({
            url:"${pageContext.request.contextPath}/comment/comment_table_question_info_init.do",
            data:{
                "question_id":$('#question_id').val()
            },
            success:function (data,status){
                if(status=="success"){
                    $("#question_content").val(data.question_content);
                    $("#question_option").val(data.question_option);
                    $("#question_ori").val(data.question_ori);
                    $("#question_class").val(data.question_class);
                    $("#question_answer").val(data.question_answer);
                    var path="${pageContext.request.contextPath}/img_artificial/"+"question_img/"+data.question_img;
                    $("#question_img").attr("src",path);

                }
            }
        })
    }


</script>

</body>
</html>
